package com.zzxy.springSun.text;

import com.zzxy.springSun.factory.MyBeanFactory;
import com.zzxy.springSun.service.impl.AccoutServiceImpl;
import com.zzxy.springSun.service.impl.IStudentService;
import com.zzxy.springSun.service.impl.StudentServiceImpl;
import javassist.runtime.Inner;
import org.apache.commons.dbcp.BasicDataSource;
import org.apache.ibatis.jdbc.SQL;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.jdbc.Sql;

public class Test {

    private static IStudentService StuServiceProxy;

    public  static void  main(String[] args) throws Exception {
//       ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "beans3.xml");
//       UserServiceImpl userService=context.getBean(UserServiceImpl.class);
//       userService.addUserr();
//        Address address = context.getBean(Address.class);
//        System.out.println(address);
//        IStudentService studentService = MyBeanFactory.createStudentService();
//        studentService.deleteStudent();
//        StudentServiceImpl studentService1 =new StudentServiceImpl();
//        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
//        StudentServiceImpl studentService = (StudentServiceImpl) context.getBean("stuService");
//        StuServiceProxy.addStudent();
//        BasicDataSource dataSource=new BasicDataSource();
//        dataSource.setUrl("jdbc:mysql.///springSun?serviceTimezone=UTC");
//        dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
//        dataSource.setUsername("root");
//        dataSource.setPassword("123456");
//        JdbcTemplate jdbcTemplate=new JdbcTemplate(dataSource);
//        String sql;
//        String sasdaccccc
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        AccoutServiceImpl accoutService = (AccoutServiceImpl)context.getBean("accoutService");
        accoutService.transer("jack","rose", "13254");

    }
}

